﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<cbelo.Helpers.PaginatedListPages<cbelo.mdfproduct>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	MDF >>> <%:ViewData["title"]%>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2><%:ViewData["title"]%></h2>
    <div class="highslide-gallery">

    <%  int idgrupo = -1;
        foreach (var item in Model) {

            if (idgrupo == -1)
                idgrupo = item.idmdf;
     %>
            <div class="photo-container" style="position:relative;width:100%;">
                <div class="photo-container1" style="width:22%;position:inherit;left:0%;height:95%;">
                  <div class="photo-top"><span></span></div>
                  <div class="photo-content"> 
                        <a href="<%: item.imagem %>" onclick="return hs.expand(this)">
	                        <img src="<%: item.imagem %>" alt="<%: item.nome %>" title="<%: item.nome %>" width="95" height="60"/>
                        </a>
                        <div class="highslide-caption">
	                        <%: item.descricao %>
                        </div>

                  </div>
                  <div class="photo-bottom"><span></span></div>
                  <div class="photo-caption"><%: item.nome %></div>
                  <div class="photo-caption-bottom"><span></span></div>
                </div>
                <div class="photo-container2" style="width:78%;position:absolute;left:24%;top:10px;height:95%;">
                    <div class="photo-text" ><%: item.descricao %></div>
                    <%= Html.ActionLink("Adicionar", "AddToCart", "ShopCart", new { id = item.idmdfproduct, type = 2},"") %>
                </div>
            </div>
            <br />
    <% } %>

    </div>

    <%  if (Model.TotalPages > 1 && idgrupo != -1)
        { 
            if (Model.HasPreviousPage)
            { %>
              <%= Html.ActionLink("« Anterior", "MDFDetails", new { id = idgrupo, page = Model.PageIndex - 1 })%>
         <% }
           else
            { %>
              « Anterior
         <% } %>

         <%for (int page = 0; page < Model.TotalPages; page++)
            {
                if (page == Model.PageIndex)
                { %>
                  <%=(page+1).ToString()%>
             <% }
            else
                { %>
                  <%= Html.ActionLink((page + 1).ToString(), "MDFDetails", new { id = idgrupo, page = page })%>
             <% }
            }

                 if (Model.HasNextPage)
                { %>
                  <%= Html.ActionLink("Próximo »", "MDFDetails", new { id = idgrupo, page = Model.PageIndex + 1 })%>
             <% }
           else
                { %>
                   Próximo »
             <% } %>
    <% } %>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="ProductContent" runat="server">
    <!--<div class="side-bucket-container">
      <div class="side-bucket-content">-->
    <div class="nav-main-container">
      <div class="nav-main-content">
      <ul>
          <% cbelo.Helpers.NonPaginatedList<cbelo.mdf> mdfData = (cbelo.Helpers.NonPaginatedList<cbelo.mdf>)ViewData["MDF"];
             foreach (var item in mdfData) { %>
            <li><%= Html.ActionLink(item.nomeMDF, "MDFDetails", new { id = item.idMDF, page = 0 })%></li>
          <% } %>
        </ul>        
        <!--<div class="side-bucket-bottom"></div>-->
        <div class="nav-main-bottom"></div>
      </div>
    </div>
</asp:Content>

